<template>
  <div style="width: 200px; height: fit-content; background: red">
    <span>
      {{ this.testkey }}
      <el-input v-model="this.val"></el-input>
    </span>
    <slot name="body"></slot>
  </div>
</template>

<script>
var ctx
export default {
  props: ["testkey", "testval", "changeEvent"],
  computed: {
    val: {
      set: (val) => {
        ctx.changeEvent && ctx.changeEvent(val)
      },
      get: () => {
        return ctx.testval ?? 0
      }
    }
  },
  created() {
    ctx = this
  }
}
</script>

<style></style>
